﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:System="clr-namespace:System;assembly=mscorlib"
	xmlns:local="clr-namespace:ParseControls">

	<!-- Colors -->
	<Thickness x:Key="BorderThickness" Bottom="1" Left="1" Top="1" Right="1" />
	<SolidColorBrush x:Key="BorderBrush" Color="#999" />
	<SolidColorBrush x:Key="ForegroundBrush" Color="#ccc" />
	<SolidColorBrush x:Key="BackgroundBrush" Color="#555" />
	<SolidColorBrush x:Key="LightBrush" Color="#ddd" />
	<SolidColorBrush x:Key="AccentBrush" Color="#eee" />
	<SolidColorBrush x:Key="ForegroundInvertBrush" Color="#fff" />
	<SolidColorBrush x:Key="transp" Color="#00ffffff" Opacity="0.0001" />
	<SolidColorBrush x:Key="smoke" Color="#FFdddddd" Opacity="0.8" />
	<RadialGradientBrush x:Key="fog" Center="0.5,0.5" RadiusX="0.5" RadiusY="0.8" 
								GradientOrigin="0.5,0.5" Opacity="0.1">
		<GradientStop Color="#44ffffff" Offset="0.0"></GradientStop>
		<GradientStop Color="#11ffffff" Offset="1.0"></GradientStop>
	</RadialGradientBrush>

	<RadialGradientBrush x:Key="radial" Center="0.5,0.5" RadiusX="0.6" RadiusY="0.4" 
								GradientOrigin="0.5,0.5">
		<GradientStop Color="#ddd" Offset="0.0"></GradientStop>
		<GradientStop Color="#aaa" Offset="1.0"></GradientStop>
	</RadialGradientBrush>
	<LinearGradientBrush x:Key="stream" StartPoint="0,0" EndPoint="0,1">
		<GradientStop Color="Transparent" Offset="0.0"></GradientStop>
		<GradientStop Color="#fff" Offset="1.0"></GradientStop>
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="streamStrong" StartPoint="0,0" EndPoint="0,1">
		<GradientStop Color="#00ffffff" Offset="0.0"></GradientStop>
		<GradientStop Color="#99ffffff" Offset="0.5"></GradientStop>
		<GradientStop Color="#FFffffff" Offset="1.0"></GradientStop>
	</LinearGradientBrush>
	<LinearGradientBrush x:Key="photoShadow" StartPoint="0,0" EndPoint="1,0">
		<GradientStop Color="White" Offset="0.0" />
		<GradientStop Color="Transparent" Offset="0.4" />
		<GradientStop Color="Transparent" Offset="0.5" />
		<GradientStop Color="Transparent" Offset="0.6" />
		<GradientStop Color="White" Offset="1" />
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="_redBrush" StartPoint="0,0" EndPoint="1,0">
		<GradientStop Color="#E32224" Offset="0.0" />
		<!--<GradientStop Color="Transparent" Offset="0.4" />
		<GradientStop Color="Transparent" Offset="0.5" />
		<GradientStop Color="Transparent" Offset="0.6" />-->
		<GradientStop Color="#AC1417" Offset="1" />
	</LinearGradientBrush>
	
	<!-- Drag Thumb  Drawing brush-->
	<DrawingBrush x:Key="vs2012Grip" Viewbox="1,1,6,6" Viewport="1,1,4,4" 
			TileMode="Tile" ViewboxUnits="Absolute" ViewportUnits="Absolute">
		<DrawingBrush.Drawing>
			<DrawingGroup>
				<GeometryDrawing Brush="#FF000000" 
								Geometry="M 3,3L3,4 4,4 4,3z">

				</GeometryDrawing>
				<GeometryDrawing Brush="#FF000000" 
								Geometry="M6,6L6,7 7,7 7,6z" >

				</GeometryDrawing>
			</DrawingGroup>
		</DrawingBrush.Drawing>
	</DrawingBrush>
	<DrawingBrush x:Key="karo" Viewport="0,0,12,12" ViewportUnits="Absolute" TileMode="Tile" Opacity="0.5">
		<DrawingBrush.Drawing>
			<DrawingGroup>
				<GeometryDrawing Geometry="M0,0 L1,0 1,0.05, 0,0.05Z" Brush="{StaticResource LightBrush}" />
				<GeometryDrawing Geometry="M0,0 L0,1 0.05,1, 0.05,0Z" Brush="{StaticResource LightBrush}" />
			</DrawingGroup>
		</DrawingBrush.Drawing>
	</DrawingBrush>
	<DrawingBrush x:Key="linie" TileMode="Tile" Stretch="None" Viewport="0,0,20,20" ViewportUnits="Absolute" Opacity="0.3">
		<DrawingBrush.Drawing>
			<GeometryDrawing>
				<GeometryDrawing.Pen>
					<Pen Brush="{StaticResource LightBrush}"/>
				</GeometryDrawing.Pen>
				<GeometryDrawing.Geometry>
					<LineGeometry StartPoint="0,0" EndPoint="20,0"/>
				</GeometryDrawing.Geometry>
			</GeometryDrawing>
		</DrawingBrush.Drawing>
	</DrawingBrush>

	<RadialGradientBrush x:Key="radialBrush" Center="0.5,0.5" RadiusX="0.8" RadiusY="0.8"  GradientOrigin="0.7,0.3">
		<GradientStop Color="#373C41" Offset="0.1"></GradientStop>
		<GradientStop Color="#282D32" Offset="1"></GradientStop>
	</RadialGradientBrush>
	<DrawingBrush x:Key="penBrush" Viewport="0,0,5,5" ViewportUnits="Absolute" TileMode="Tile">
		<DrawingBrush.Drawing>
			<GeometryDrawing>
				<GeometryDrawing.Geometry>
					<GeometryGroup>
						<LineGeometry StartPoint="0,0" EndPoint="1,1" />
					</GeometryGroup>
				</GeometryDrawing.Geometry>
				<GeometryDrawing.Pen>
					<Pen Thickness="100">
						<Pen.Brush>
							<SolidColorBrush Color="#999999"/>
						</Pen.Brush>
					</Pen>
				</GeometryDrawing.Pen>
			</GeometryDrawing>
		</DrawingBrush.Drawing>
	</DrawingBrush>

	<System:Double x:Key="HorizontalThumbHeight">16</System:Double>
	<System:Double x:Key="HorizontalThumbWidth">10</System:Double>
	<System:Double x:Key="VerticalThumbWidth">16</System:Double>
	<System:Double x:Key="VerticalThumbHeight">10</System:Double>

	<!-- Shadow -->
	<DropShadowEffect x:Key="shadow" BlurRadius="9" 
					  ShadowDepth="3" Color="#cccccc" 
				Direction="270" RenderingBias="Performance" />
	<DropShadowEffect x:Key="shadowWhite" BlurRadius="5" 
					  ShadowDepth="1" Color="#cccccc" 
				Direction="270" RenderingBias="Performance" />
	<DropShadowEffect x:Key="shadowLight" BlurRadius="5" 
					  ShadowDepth="1" Color="#f3f3f3" 
				Direction="270" RenderingBias="Performance" />
	<DropShadowEffect x:Key="shadowDark" BlurRadius="15" 
					  ShadowDepth="5" Color="#999999" 
				Direction="270" RenderingBias="Performance" />
	<DropShadowEffect x:Key="navigShadow" BlurRadius="5" ShadowDepth="2" 
					  Color="#777" RenderingBias="Performance" />

	<!-- FocusVisual -->
	<Style x:Key="SimpleFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Border BorderBrush="Transparent" 
							BorderThickness="0"
							 SnapsToDevicePixels="true" >
						<!--<Border.Effect>
							<DropShadowEffect ShadowDepth="0" 
											  Color="Gray" 
											  BlurRadius="5" />
						</Border.Effect>-->
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<local:StringVisibilityConverter x:Key="svc"/>
	<local:BooleanToHiddenVisibility x:Key="btvConverter"/>

	<!-- TextBox -->
	<Style TargetType="{x:Type local:FwTextBox}">
		<Setter Property="Opacity" Value="0"/>
		<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
		<Setter Property="RenderTransform">
			<Setter.Value>
				<TranslateTransform Y="-10" />
			</Setter.Value>
		</Setter>
		<Setter Property="FocusVisualStyle" Value="{StaticResource SimpleFocusVisual}"/>
		<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
		<Setter Property="BorderBrush" Value="{StaticResource transp}"/>
		<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
        <Setter Property="Background" Value="{StaticResource transp}"/>
		<Setter Property="MinHeight" Value="23"/>
		<Setter Property="SnapsToDevicePixels" Value="True" />
		<Setter Property="VerticalAlignment" Value="Center" />
		<Setter Property="VerticalContentAlignment" Value="Center" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:FwTextBox}">
					<Border Background="{TemplateBinding Background}"
							BorderBrush="{TemplateBinding BorderBrush}"
							BorderThickness="{TemplateBinding BorderThickness}"
							 SnapsToDevicePixels="True" >
						<Grid SnapsToDevicePixels="True" >
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="Auto"/>
							</Grid.ColumnDefinitions>

							<Rectangle x:Name="rect" Grid.ColumnSpan="2"
									   Fill="{StaticResource transp}" 
									   SnapsToDevicePixels="True" Stroke="{StaticResource smoke}"
									   StrokeThickness="{TemplateBinding BorderThickness}"/>

							<TextBlock x:Name="PART_BackgroundTextHost" Opacity="0.6"
									   FontSize="{TemplateBinding BackgroundTextFontSize}"
											   Text="{TemplateBinding BackgroundText}" FontWeight="Normal"
											   Foreground="{TemplateBinding BackgroundTextBrush}"
											   Grid.Column="0" Margin="5,0,0,0"  SnapsToDevicePixels="True"
												  VerticalAlignment="{TemplateBinding VerticalAlignment}" />

							<local:FwScrollViewer Grid.Column="0" Margin="2,0,0,0" 
												  VerticalAlignment="{TemplateBinding VerticalAlignment}"
												  VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
										  x:Name="PART_ContentHost" SnapsToDevicePixels="True"/>

							<!--<ContentPresenter ContentSource="Placeholder" Grid.Column="1"  SnapsToDevicePixels="True" />

				                    <Popup x:Name="Popup" SnapsToDevicePixels="True"
								   Placement="Bottom" PopupAnimation="Fade" StaysOpen="False" 
								   Grid.ColumnSpan="2" IsOpen="{TemplateBinding IsDropDownOpen}" 
									   AllowsTransparency="True" Focusable="False" >
								<Border x:Name="dropDown" SnapsToDevicePixels="True"
									Background="{StaticResource BackgroundBrush}" 
										BorderBrush="{TemplateBinding PopupBorderBrush}" 
										BorderThickness="{TemplateBinding PopupBorderThickness}" 
										Width="{TemplateBinding ActualWidth}" 
										MinWidth="{TemplateBinding ActualWidth}"
										  MaxHeight="230" >

									--><!-- SelectionMode="Single" IsSynchronizedWithCurrentItem="True" --><!--
									<ListBox ItemsSource="{Binding Path=TextBoxItems, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
											SelectedItem="{Binding Path=SelectedTextBoxItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Delay=800}">
										<ListBox.ItemTemplate>
											<DataTemplate>
												<Grid Background="{StaticResource transp}">
													<TextBlock Text="{Binding Title}" Margin="3"
														Foreground="{StaticResource LightBrush}" />
												</Grid>
											</DataTemplate>
										</ListBox.ItemTemplate>
									</ListBox>

								</Border>
							</Popup>-->
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<EventTrigger RoutedEvent="Loaded">
							<BeginStoryboard>
								<Storyboard Storyboard.DesiredFrameRate="30">
									<DoubleAnimation Storyboard.TargetProperty="Opacity" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="0" To="1" Duration="0:0:0.4"  />
									<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="-10" To="0" Duration="0:0:0.7"  />
								</Storyboard>
							</BeginStoryboard>
						</EventTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="True"/>
								<!--<Condition Property="AllowEffects" Value="True"/>-->
							</MultiTrigger.Conditions>
							<Setter Property="Visibility" Value="Visible" TargetName="rect"/>
							<Setter Property="StrokeThickness" Value="1" TargetName="rect"/>
							<Setter Property="Stroke" Value="{StaticResource LightBrush}" TargetName="rect"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsFocused" Value="True"/>
								<!--<Condition Property="AllowEffects" Value="True"/>-->
							</MultiTrigger.Conditions>
							<Setter Property="Visibility" Value="Visible" TargetName="rect"/>
							<Setter Property="StrokeThickness" Value="1" TargetName="rect"/>
							<Setter Property="Stroke" Value="{StaticResource AccentBrush}" TargetName="rect"/>
						</MultiTrigger>
						<!--<Trigger Property="AllowEffects" Value="false">
							<Setter TargetName="rect" Property="Visibility" Value="Collapsed" />
						</Trigger>-->
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<!-- Button -->
	<Style TargetType="{x:Type local:FwButton}">
		<Setter Property="Opacity" Value="0"/>
		<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
		<Setter Property="RenderTransform">
			<Setter.Value>
				<TranslateTransform X="30" />
			</Setter.Value>
		</Setter>
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="FocusVisualStyle" Value="{StaticResource SimpleFocusVisual}"/>
		<Setter Property="MinHeight" Value="30"/>
		<Setter Property="MinWidth" Value="30"/>
		<Setter Property="FontWeight" Value="Bold"/>
		<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
		<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
		<Setter Property="Background" Value="{StaticResource transp}"/>
		<Setter Property="BorderThickness" Value="{StaticResource BorderThickness}"/>
		<Setter Property="HorizontalAlignment" Value="Stretch"/>
		<Setter Property="VerticalAlignment" Value="Stretch" />
		<Setter Property="HorizontalContentAlignment" Value="Center"/>
		<Setter Property="VerticalContentAlignment" Value="Center" />
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="Padding" Value="7,1,7,1"/>
		<Setter Property="VerticalAlignment" Value="Center" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:FwButton}">

					<Border  x:Name="Border" SnapsToDevicePixels="True"
							 Opacity="{TemplateBinding Opacity}"  Cursor="Hand"
							Background="{TemplateBinding Background}"  
							BorderBrush="{TemplateBinding BorderBrush}" 
							BorderThickness="{TemplateBinding BorderThickness}">

						<Grid x:Name="_root" SnapsToDevicePixels="True" 
							   Opacity="{TemplateBinding Opacity}" >
							<Grid.RowDefinitions>
								<RowDefinition Height="*"/>
								<RowDefinition Height="Auto"/>
							</Grid.RowDefinitions>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="*"/>
							</Grid.ColumnDefinitions>

							<Rectangle x:Name="rectEffect" 
									   Grid.RowSpan="2" Grid.ColumnSpan="2"
									   Fill="{TemplateBinding Background}" 
									   SnapsToDevicePixels="True"  />

							<!--<Rectangle x:Name="rectbg" 
									   Grid.RowSpan="2" Grid.ColumnSpan="2"
									   Fill="{TemplateBinding Background}" 
									   SnapsToDevicePixels="True"  />-->

							<Rectangle x:Name="rectFront" 
									   Grid.RowSpan="2" Grid.ColumnSpan="2"
									   Fill="{StaticResource AccentBrush}" 
									   Opacity="0.0" SnapsToDevicePixels="True"  />

							<Rectangle x:Name="rectLeft" Grid.RowSpan="2" 
									   Fill="{StaticResource radialBrush}" 
									   Opacity="0.0" SnapsToDevicePixels="True"  />

							<Rectangle x:Name="rectLeftTop" Grid.RowSpan="2" Opacity="0.0" 
								Fill="{StaticResource penBrush}" SnapsToDevicePixels="True"  />

							<!-- Logo -->
							<!--<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalAlignment}" 
											  Grid.Row="0" Grid.Column="0" Grid.RowSpan="2"
											VerticalAlignment="{TemplateBinding HorizontalAlignment}"  
											  ContentSource="Logo" SnapsToDevicePixels="True"
										Visibility="{TemplateBinding Logo, Converter={StaticResource nvc}}"/>-->

							<!-- Content -->
							<ContentPresenter Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" 
											  Grid.Row="0" Grid.Column="1"  Opacity="{TemplateBinding Opacity}" 
											HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
											VerticalAlignment="{TemplateBinding VerticalContentAlignment}"  
											  ContentSource="Content" SnapsToDevicePixels="True"/>

							<!-- Placeholder -->
							<!--<ContentPresenter  Grid.Row="1" Grid.Column="1"
										HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
										VerticalAlignment="{TemplateBinding VerticalContentAlignment}"  
										ContentSource="Placeholder" SnapsToDevicePixels="True"
											Visibility="{TemplateBinding Placeholder, Converter={StaticResource nvc}}" />-->
						</Grid>

					</Border>

					<ControlTemplate.Triggers>
						<EventTrigger RoutedEvent="Loaded">
							<BeginStoryboard>
								<Storyboard Storyboard.DesiredFrameRate="30">
									<DoubleAnimation Storyboard.TargetProperty="Opacity" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="0" To="1" Duration="0:0:0.4"  />
									<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="30" To="0" Duration="0:0:0.7"  />
								</Storyboard>
							</BeginStoryboard>
						</EventTrigger>

						<!-- Normal -->
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="False"/>
							</MultiTrigger.Conditions>
							<!--<Setter Property="Background" Value="{StaticResource LightBrush}"/>-->
							<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="True"/>
							</MultiTrigger.Conditions>
							<!--<Setter Property="Background" Value="{StaticResource AccentBrush}"/>-->
							<Setter Property="Foreground" Value="{StaticResource ForegroundInvertBrush}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="True"/>
								<Condition Property="IsPressed" Value="True"/>
							</MultiTrigger.Conditions>
							<!--<Setter Property="Background" Value="{StaticResource AccentBrush}"/>-->
							<Setter Property="Foreground" Value="{StaticResource ForegroundInvertBrush}"/>
							<Setter Property="FontWeight" Value="Normal" />
						</MultiTrigger>

					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Style.Triggers>
			<!-- Properties -->
			<Trigger Property="IsEnabled" Value="False">
				<Setter Property="Opacity" Value="0.8"/>
				<Setter Property="Cursor" Value="No" />
			</Trigger>
		</Style.Triggers>
	</Style>

	<!-- Toggle -->
	<Style TargetType="{x:Type local:FwToggleButton}">
		<Setter Property="Opacity" Value="0"/>
		<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
		<Setter Property="RenderTransform">
			<Setter.Value>
				<TranslateTransform X="30" />
			</Setter.Value>
		</Setter>
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="FocusVisualStyle" Value="{StaticResource SimpleFocusVisual}"/>
		<Setter Property="MinHeight" Value="30"/>
		<Setter Property="MinWidth" Value="30"/>
		<Setter Property="FontWeight" Value="Bold"/>
		<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
		<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
		<Setter Property="Background" Value="{StaticResource transp}"/>
		<Setter Property="BorderThickness" Value="{StaticResource BorderThickness}"/>
		<Setter Property="HorizontalAlignment" Value="Stretch"/>
		<Setter Property="VerticalAlignment" Value="Stretch" />
		<Setter Property="HorizontalContentAlignment" Value="Center"/>
		<Setter Property="VerticalContentAlignment" Value="Center" />
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="Padding" Value="7,1,7,1"/>
		<Setter Property="VerticalAlignment" Value="Center" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:FwToggleButton}">

					<Border  x:Name="Border" SnapsToDevicePixels="True" Cursor="Hand"
							Background="{TemplateBinding Background}"  
							BorderBrush="{TemplateBinding BorderBrush}" 
							BorderThickness="{TemplateBinding BorderThickness}">
						<Grid x:Name="_root" SnapsToDevicePixels="True" >

							<Rectangle x:Name="rectFront" 	Fill="{StaticResource AccentBrush}" 
									   Opacity="0.0" SnapsToDevicePixels="True"  />

							<ContentPresenter ContentSource="Content" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" 
										HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
											VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
											  SnapsToDevicePixels="True"/>

						</Grid>
					</Border>

					<ControlTemplate.Triggers>
						<EventTrigger RoutedEvent="Loaded">
							<BeginStoryboard>
								<Storyboard Storyboard.DesiredFrameRate="30">
									<DoubleAnimation Storyboard.TargetProperty="Opacity" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="0" To="1" Duration="0:0:0.4"  />
									<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="30" To="0" Duration="0:0:0.7"  />
								</Storyboard>
							</BeginStoryboard>
						</EventTrigger>

						<!-- Normal -->
						<!--<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="False"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" Value="{StaticResource LightBrush}"/>
							<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" Value="{StaticResource AccentBrush}"/>
							<Setter Property="Foreground" Value="{StaticResource ForegroundInvertBrush}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="True"/>
								<Condition Property="IsPressed" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" Value="{StaticResource AccentBrush}"/>
							<Setter Property="Foreground" Value="{StaticResource ForegroundInvertBrush}"/>
							<Setter Property="FontWeight" Value="Normal" />
						</MultiTrigger>-->

					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- CheckBox -->
    <ControlTemplate x:Key="checkBoxStar" TargetType="{x:Type local:FwCheckBox}">
        <BulletDecorator Background="Transparent">
            <BulletDecorator.Bullet>
                <Border x:Name="Border"  Width="24" Height="24">
                    <Border x:Name="CheckMark" Width="24" Height="24" 
											SnapsToDevicePixels="True"
										HorizontalAlignment="Left" VerticalAlignment="Center"
										Margin="0,0,0,0" Cursor="Hand" >

                        <Grid>
                            <Border x:Name="PART_TruePart" 
												SnapsToDevicePixels="True" Visibility="Collapsed"
												VerticalAlignment="Center" HorizontalAlignment="Center" >
                                <Viewbox>
                                    <Canvas  Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0" Margin="-10">
                                        <Path  Width="41.1667" Height="38" Canvas.Left="17.4167" Canvas.Top="18" Stretch="Fill" 
						                        Fill="#FFA00505" 
							                    Data="F1 M 17.4167,32.25L 32.9107,32.25L 38,18L 43.0893,32.25L 58.5833,32.25L 45.6798,41.4944L 51.4583,56L 38,48.0833L 26.125,56L 30.5979,41.7104L 17.4167,32.25 Z "/>
                                    </Canvas>
                                </Viewbox>
                            </Border>
                            <Border x:Name="PART_NullPart" 
												SnapsToDevicePixels="True" Visibility="Collapsed"
												VerticalAlignment="Center" HorizontalAlignment="Center" >
                                <Viewbox>
                                    <Canvas  Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0" Margin="-10">
                                        <Path Width="41.1667" Height="38" Canvas.Left="17.4167" Canvas.Top="18" Stretch="Fill" 
						                        Fill="#FFA00505" 
							                    Data="F1 M 17.4167,32.25L 32.9107,32.25L 38,18L 43.0893,32.25L 58.5833,32.25L 45.6798,41.4944L 51.4583,56L 38,48.0833L 26.125,56L 30.5979,41.7104L 17.4167,32.25 Z "/>
                                    </Canvas>
                                </Viewbox>
                            </Border>
                            <Border x:Name="PART_FalsePart" 
												SnapsToDevicePixels="True" Visibility="Collapsed"
												VerticalAlignment="Center" HorizontalAlignment="Center" >
                                <Viewbox>
                                    <Canvas  Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0" Margin="-10">
                                        <Path Width="41.1667" Height="38" Canvas.Left="17.4167" Canvas.Top="18" Stretch="Fill" 
						                        Fill="#ffcccccc" 
							                    Data="F1 M 17.4167,32.25L 32.9107,32.25L 38,18L 43.0893,32.25L 58.5833,32.25L 45.6798,41.4944L 51.4583,56L 38,48.0833L 26.125,56L 30.5979,41.7104L 17.4167,32.25 Z "/>
                                    </Canvas>
                                </Viewbox>
                            </Border>
                        </Grid>

                    </Border>
                </Border>
            </BulletDecorator.Bullet>

            <Grid SnapsToDevicePixels="True">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>

                <ContentPresenter Margin="10,0,0,0" Grid.Column="0"
									SnapsToDevicePixels="True" TextBlock.Foreground="{TemplateBinding Foreground}"
									VerticalAlignment="Center"	HorizontalAlignment="Left"/>
            </Grid>

        </BulletDecorator>

        <ControlTemplate.Triggers>
            <!--<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Background" Value="{StaticResource BackgroundBrush}" TargetName="Border" />
				<Setter Property="Background" Value="{StaticResource BackgroundBrush}" TargetName="CheckMark" />

				<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" TargetName="PART_TruePart" />
				<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" TargetName="PART_FalsePart" />
				<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" TargetName="PART_NullPart" />
				<Setter Property="BorderThickness" Value="0" TargetName="Border" />
			</Trigger>-->
            <Trigger Property="IsChecked" Value="false">
                <Setter TargetName="CheckMark" Property="HorizontalAlignment" Value="Right"/>
                <Setter TargetName="PART_TruePart" Property="Visibility" Value="Collapsed" />
                <Setter TargetName="PART_FalsePart" Property="Visibility" Value="Visible" />
                <Setter TargetName="PART_NullPart" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsChecked" Value="{x:Null}">
                <Setter TargetName="CheckMark" Property="HorizontalAlignment" Value="Center" />
                <Setter TargetName="PART_TruePart" Property="Visibility" Value="Collapsed" />
                <Setter TargetName="PART_FalsePart" Property="Visibility" Value="Collapsed" />
                <Setter TargetName="PART_NullPart" Property="Visibility" Value="Visible" />
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
                <Setter TargetName="CheckMark" Property="HorizontalAlignment" Value="Left" />
                <Setter TargetName="PART_TruePart" Property="Visibility" Value="Visible" />
                <Setter TargetName="PART_FalsePart" Property="Visibility" Value="Collapsed" />
                <Setter TargetName="PART_NullPart" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
                <!--<Setter TargetName="Border" Property="Background" Value="Red" />-->
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
                <!--<Setter TargetName="Border" Property="Background" Value="Blue" />
								<Setter TargetName="Border" Property="BorderBrush" Value="Navy" />-->
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <!--<Setter TargetName="Border" Property="Background" Value="WhiteSmoke" />
								<Setter TargetName="Border" Property="BorderBrush" Value="Silver" />
								<Setter Property="Foreground" Value="Gray"/>-->
            </Trigger>
            <EventTrigger RoutedEvent="Loaded">
                <BeginStoryboard>
                    <Storyboard Storyboard.DesiredFrameRate="30">
                        <DoubleAnimation Storyboard.TargetProperty="Opacity" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="0" To="1" Duration="0:0:0.4"  />
                        <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="30" To="0" Duration="0:0:0.7"  />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <ControlTemplate x:Key="checkBoxRectangle" TargetType="{x:Type local:FwCheckBox}">
		<BulletDecorator Background="Transparent">
				<BulletDecorator.Bullet>
					<Border x:Name="Border"  Width="24" Height="24">
						<Border x:Name="CheckMark" Width="24" Height="24" 
											SnapsToDevicePixels="True"
										HorizontalAlignment="Left" VerticalAlignment="Center"
										Margin="0,0,0,0" Cursor="Hand" >

							<Grid>
								<Border x:Name="PART_TruePart" 
												SnapsToDevicePixels="True" Visibility="Collapsed"
												VerticalAlignment="Center" HorizontalAlignment="Center" >
									<Viewbox>
										<Canvas x:Name="appbar_checkmark_thick" Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0" Margin="-15">
											<Path Width="34.2877" Height="29.4585" Canvas.Left="22" Canvas.Top="24.5415" Stretch="Fill" 
												  Fill="{TemplateBinding CheckBoxForeground}" Data="F1 M 32.2209,33.4875L 39.1875,40.0582L 52.9627,24.5415L 56.2877,27.4707L 39.5834,47.5L 28.8959,36.8125L 32.2209,33.4875 Z M 22,25L 50,25L 45.5,30L 27,30L 27,49L 46,49L 46,42.5L 51,36.5L 51,54L 22,54L 22,25 Z "/>
										</Canvas>
									</Viewbox>
								</Border>
							<Border x:Name="PART_NullPart" 
												SnapsToDevicePixels="True" Visibility="Collapsed"
												VerticalAlignment="Center" HorizontalAlignment="Center" >
									<Viewbox>
										<Canvas x:Name="appbar_checkmark_cross" Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0" Margin="-15">
											<Path Width="32" Height="32" Canvas.Left="22" Canvas.Top="22" Stretch="Fill" 
												  Fill="{TemplateBinding CheckBoxForeground}" Data="F1 M 22,54L 22,22L 54,22L 54,54L 22,54 Z M 26,26L 26,50L 50,50L 50,26L 26,26 Z M 30.755,27.65L 38,34.895L 45.2449,27.6501L 48.3499,30.7551L 41.105,38L 48.35,45.245L 45.245,48.35L 38,41.105L 30.755,48.35L 27.65,45.245L 34.895,38L 27.65,30.755L 30.755,27.65 Z "/>
										</Canvas>
									</Viewbox>
								</Border>
							<Border x:Name="PART_FalsePart" 
												SnapsToDevicePixels="True" Visibility="Collapsed"
												VerticalAlignment="Center" HorizontalAlignment="Center" >
									<Viewbox>
										<Canvas x:Name="appbar_checkmark_thick_unchecked" Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0" Margin="-15">
											<Path Width="30" Height="30" Canvas.Left="23" Canvas.Top="23" Stretch="Fill" 
												  Fill="{TemplateBinding CheckBoxForeground}" Data="F1 M 23,23L 53,23L 53,53L 23,53L 23,23 Z M 28,28L 28,48L 48,48L 48,28L 28,28 Z "/>
										</Canvas>
									</Viewbox>
								</Border>
							</Grid>

						</Border>
					</Border>
				</BulletDecorator.Bullet>

				<Grid SnapsToDevicePixels="True">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="*"/>
						<ColumnDefinition Width="Auto"/>
					</Grid.ColumnDefinitions>

					<ContentPresenter Margin="10,0,0,0" Grid.Column="0"
									SnapsToDevicePixels="True" TextBlock.Foreground="{TemplateBinding Foreground}"
									VerticalAlignment="Center"	HorizontalAlignment="Left"/>
				</Grid>

			</BulletDecorator>

		<ControlTemplate.Triggers>
			<!--<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Background" Value="{StaticResource BackgroundBrush}" TargetName="Border" />
				<Setter Property="Background" Value="{StaticResource BackgroundBrush}" TargetName="CheckMark" />

				<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" TargetName="PART_TruePart" />
				<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" TargetName="PART_FalsePart" />
				<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" TargetName="PART_NullPart" />
				<Setter Property="BorderThickness" Value="0" TargetName="Border" />
			</Trigger>-->
			<Trigger Property="IsChecked" Value="false">
				<Setter TargetName="CheckMark" Property="HorizontalAlignment" Value="Right"/>
				<Setter TargetName="PART_TruePart" Property="Visibility" Value="Collapsed" />
				<Setter TargetName="PART_FalsePart" Property="Visibility" Value="Visible" />
				<Setter TargetName="PART_NullPart" Property="Visibility" Value="Collapsed" />
			</Trigger>
			<Trigger Property="IsChecked" Value="{x:Null}">
				<Setter TargetName="CheckMark" Property="HorizontalAlignment" Value="Center" />
				<Setter TargetName="PART_TruePart" Property="Visibility" Value="Collapsed" />
				<Setter TargetName="PART_FalsePart" Property="Visibility" Value="Collapsed" />
				<Setter TargetName="PART_NullPart" Property="Visibility" Value="Visible" />
			</Trigger>
			<Trigger Property="IsChecked" Value="true">
				<Setter TargetName="CheckMark" Property="HorizontalAlignment" Value="Left" />
				<Setter TargetName="PART_TruePart" Property="Visibility" Value="Visible" />
				<Setter TargetName="PART_FalsePart" Property="Visibility" Value="Collapsed" />
				<Setter TargetName="PART_NullPart" Property="Visibility" Value="Collapsed" />
			</Trigger>
			<Trigger Property="IsMouseOver" Value="true">
				<!--<Setter TargetName="Border" Property="Background" Value="Red" />-->
			</Trigger>
			<Trigger Property="IsPressed" Value="true">
				<!--<Setter TargetName="Border" Property="Background" Value="Blue" />
								<Setter TargetName="Border" Property="BorderBrush" Value="Navy" />-->
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<!--<Setter TargetName="Border" Property="Background" Value="WhiteSmoke" />
								<Setter TargetName="Border" Property="BorderBrush" Value="Silver" />
								<Setter Property="Foreground" Value="Gray"/>-->
			</Trigger>
			<EventTrigger RoutedEvent="Loaded">
				<BeginStoryboard>
					<Storyboard Storyboard.DesiredFrameRate="30">
						<DoubleAnimation Storyboard.TargetProperty="Opacity" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="0" To="1" Duration="0:0:0.4"  />
						<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="30" To="0" Duration="0:0:0.7"  />
					</Storyboard>
				</BeginStoryboard>
			</EventTrigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<ControlTemplate x:Key="checkBoxSwipe" TargetType="{x:Type local:FwCheckBox}">
		<Border BorderThickness="{TemplateBinding BorderThickness}" 
							BorderBrush="{TemplateBinding BorderBrush}"
							SnapsToDevicePixels="True">
			<BulletDecorator Background="Transparent">
				<BulletDecorator.Bullet>
					<Border x:Name="Border"  Width="50" Height="23">
						<Border x:Name="CheckMark" Width="30" Height="19" 
											SnapsToDevicePixels="True"
										Background="{StaticResource AccentBrush}"
										HorizontalAlignment="Left" VerticalAlignment="Center"
										Margin="0,0,0,0" Cursor="Hand" >

							<Grid>
								<TextBlock x:Name="PART_TruePart" FontWeight="Bold"  
												   Text="{TemplateBinding TrueText}"
												Foreground="{TemplateBinding CheckBoxForeground}" 
												SnapsToDevicePixels="True" Visibility="Collapsed"
												VerticalAlignment="Center" HorizontalAlignment="Center" />
								<TextBlock x:Name="PART_FalsePart" FontWeight="Bold"  
												   Text="{TemplateBinding FalseText}"
												Foreground="{TemplateBinding CheckBoxForeground}" 
												SnapsToDevicePixels="True" Visibility="Collapsed"
												VerticalAlignment="Center" HorizontalAlignment="Center" />
								<TextBlock x:Name="PART_NullPart" FontWeight="Bold"  
												   Text="NULL" Foreground="{TemplateBinding CheckBoxForeground}" 
												SnapsToDevicePixels="True" Visibility="Collapsed"
												VerticalAlignment="Center" HorizontalAlignment="Center" />
							</Grid>

						</Border>
					</Border>
				</BulletDecorator.Bullet>

				<Grid SnapsToDevicePixels="True">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="*"/>
						<ColumnDefinition Width="Auto"/>
					</Grid.ColumnDefinitions>

					<ContentPresenter Margin="10,0,0,0" Grid.Column="0"
									SnapsToDevicePixels="True" TextBlock.Foreground="{TemplateBinding Foreground}"
									VerticalAlignment="Center"	HorizontalAlignment="Left"/>
				</Grid>

			</BulletDecorator>
		</Border>

		<ControlTemplate.Triggers>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Background" Value="{StaticResource BackgroundBrush}" TargetName="Border" />
				<Setter Property="Background" Value="{StaticResource BackgroundBrush}" TargetName="CheckMark" />

				<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" TargetName="PART_TruePart" />
				<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" TargetName="PART_FalsePart" />
				<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" TargetName="PART_NullPart" />
				<Setter Property="BorderThickness" Value="0" TargetName="Border" />
			</Trigger>
			<Trigger Property="IsChecked" Value="false">
				<Setter TargetName="CheckMark" Property="HorizontalAlignment" Value="Right"/>
				<Setter TargetName="PART_TruePart" Property="Visibility" Value="Collapsed" />
				<Setter TargetName="PART_FalsePart" Property="Visibility" Value="Visible" />
				<Setter TargetName="PART_NullPart" Property="Visibility" Value="Collapsed" />
			</Trigger>
			<Trigger Property="IsChecked" Value="{x:Null}">
				<Setter TargetName="CheckMark" Property="HorizontalAlignment" Value="Center" />
				<Setter TargetName="PART_TruePart" Property="Visibility" Value="Collapsed" />
				<Setter TargetName="PART_FalsePart" Property="Visibility" Value="Collapsed" />
				<Setter TargetName="PART_NullPart" Property="Visibility" Value="Visible" />
			</Trigger>
			<Trigger Property="IsChecked" Value="true">
				<Setter TargetName="CheckMark" Property="HorizontalAlignment" Value="Left" />
				<Setter TargetName="PART_TruePart" Property="Visibility" Value="Visible" />
				<Setter TargetName="PART_FalsePart" Property="Visibility" Value="Collapsed" />
				<Setter TargetName="PART_NullPart" Property="Visibility" Value="Collapsed" />
			</Trigger>
			<Trigger Property="IsMouseOver" Value="true">
				<!--<Setter TargetName="Border" Property="Background" Value="Red" />-->
			</Trigger>
			<Trigger Property="IsPressed" Value="true">
				<!--<Setter TargetName="Border" Property="Background" Value="Blue" />
								<Setter TargetName="Border" Property="BorderBrush" Value="Navy" />-->
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<!--<Setter TargetName="Border" Property="Background" Value="WhiteSmoke" />
								<Setter TargetName="Border" Property="BorderBrush" Value="Silver" />
								<Setter Property="Foreground" Value="Gray"/>-->
			</Trigger>
			<EventTrigger RoutedEvent="Loaded">
				<BeginStoryboard>
					<Storyboard Storyboard.DesiredFrameRate="30">
						<DoubleAnimation Storyboard.TargetProperty="Opacity" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="0" To="1" Duration="0:0:0.4"  />
						<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="30" To="0" Duration="0:0:0.7"  />
					</Storyboard>
				</BeginStoryboard>
			</EventTrigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<Style TargetType="{x:Type local:FwCheckBox}">
		<Setter Property="Opacity" Value="0"/>
		<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
		<Setter Property="RenderTransform">
			<Setter.Value>
				<TranslateTransform X="30" />
			</Setter.Value>
		</Setter>
		<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
		<Setter Property="BorderBrush" Value="{StaticResource transp}"/>
		<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
		<Setter Property="Background" Value="{StaticResource BackgroundBrush}"/>
		<Setter Property="BorderThickness" Value="{StaticResource BorderThickness}"/>
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="SnapsToDevicePixels" Value="true"/>
		<Setter Property="FocusVisualStyle" Value="{StaticResource SimpleFocusVisual}"/>
		<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" />
		<Setter Property="CheckBoxForeground" Value="{StaticResource ForegroundInvertBrush}" />
		<Setter Property="Height" Value="23"/>
		<Setter Property="VerticalAlignment" Value="Center" />
		<Setter Property="Template" Value="{StaticResource checkBoxRectangle}" />
        <Style.Triggers>
            <Trigger Property="CheckBoxVisualType" Value="Shuffle">
                <Setter Property="Template" Value="{StaticResource checkBoxSwipe}"/>
            </Trigger>
            <Trigger Property="CheckBoxVisualType" Value="CheckBox">
                <Setter Property="Template" Value="{StaticResource checkBoxRectangle}"/>
            </Trigger>
            <Trigger Property="CheckBoxVisualType" Value="Star">
                <Setter Property="Template" Value="{StaticResource checkBoxStar}"/>
            </Trigger>
        </Style.Triggers>
	</Style>
	
	<!-- ComboBox -->
	<Style x:Key="_toggle" TargetType="{x:Type ToggleButton}">
		<Setter Property="MinWidth" Value="28" />
		<Setter Property="MinHeight" Value="28" />
		<Setter Property="Height" Value="28" />
		<Setter Property="Focusable" Value="False"/>
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="VerticalAlignment" Value="Center" />
		<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Grid x:Name="Grid" VerticalAlignment="Stretch" 
						  HorizontalAlignment="Stretch" 
						  SnapsToDevicePixels="True" Cursor="Hand" >
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="*"/>
							<ColumnDefinition Width="Auto"/>
						</Grid.ColumnDefinitions>

						<Rectangle SnapsToDevicePixels="True"
								   x:Name="ExpandedPath" Grid.Column="1" />

						<Rectangle Stroke="{StaticResource BorderBrush}" StrokeThickness="1" 
								   Fill="{StaticResource BorderBrush}" 
								   x:Name="IsExpandedPath" Grid.Column="1" 
									SnapsToDevicePixels="True"
								   Visibility="Collapsed"/>

						<Viewbox Grid.Column="1" SnapsToDevicePixels="True">
							<Canvas x:Name="appbar_layer" Width="76.0106" Height="76.0106"  SnapsToDevicePixels="True"
									Clip="F1 M 0,0L 76.0106,0L 76.0106,76.0106L 0,76.0106L 0,0" Margin="-10">
								<Path Width="38.0053" Height="38.0053" Canvas.Left="19.0026" Canvas.Top="19.0027"  SnapsToDevicePixels="True"
									  Stretch="Fill" Fill="{StaticResource ForegroundInvertBrush}" 
									  Data="F1 M 57.0079,38.0053L 38.0053,47.5066L 19.0027,38.0053L 25.3369,34.8382L 38.0053,41.1724L 50.6737,34.8382L 57.0079,38.0053 Z M 38.0053,19.0027L 57.0079,28.504L 38.0053,38.0053L 19.0026,28.504L 38.0053,19.0027 Z M 57.0079,47.5066L 38.0053,57.008L 19.0026,47.5066L 25.3369,44.3395L 38.0053,50.6737L 50.6737,44.3395L 57.0079,47.5066 Z "/>
							</Canvas>
						</Viewbox>
					</Grid>

					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Cursor" Value="Hand" TargetName="Grid"/>
							<Setter TargetName="IsExpandedPath" Property="Visibility" Value="Visible" />
							<Setter TargetName="ExpandedPath" Property="Visibility" Value="Collapsed" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="_cboItemStyle" TargetType="ComboBoxItem">
		<Setter Property="Opacity" Value="0"/>
		<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
		<Setter Property="RenderTransform">
			<Setter.Value>
				<TranslateTransform Y="-20" />
			</Setter.Value>
		</Setter>
		<Setter Property="FocusVisualStyle" Value="{StaticResource SimpleFocusVisual}"/>
		<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
		<Setter Property="Background" Value="{StaticResource BackgroundBrush}"/>
		<Setter Property="BorderBrush" Value="{StaticResource transp}"/>
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="TextBlock.TextTrimming" Value="CharacterEllipsis" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ComboBoxItem">
					<Border x:Name="brd" SnapsToDevicePixels="True"
								BorderBrush="{TemplateBinding BorderBrush}" 
								BorderThickness="{TemplateBinding BorderThickness}" 
								Background="{TemplateBinding Background}" >
						<Grid  SnapsToDevicePixels="True" >
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="*"/>
							</Grid.ColumnDefinitions>

							<Rectangle x:Name="bgMouseOver" SnapsToDevicePixels="True" 
										Stroke="#777" 
										Fill="#777" 
										Opacity="0.3" Visibility="Collapsed"  Grid.ColumnSpan="2" />

							<Rectangle x:Name="bgSelected" SnapsToDevicePixels="True" 
										Stroke="#999" 
										Fill="#999" 
										Opacity="0.3" Visibility="Collapsed"  Grid.ColumnSpan="2" />

							<Rectangle Stroke="{StaticResource BorderBrush}" 
								   StrokeThickness="2" Margin="3,3,5,3" Width="10" Height="10"
										   VerticalAlignment="Center" 
								   x:Name="IsExpandedPath" Grid.Column="0" />


							<ContentPresenter Margin="3"  HorizontalAlignment="Stretch" 
											  Content="{TemplateBinding Content}"   Grid.Column="1" 
											  ContentTemplate="{TemplateBinding ContentTemplate}"
												SnapsToDevicePixels="true" />
						</Grid>

					</Border>
					<ControlTemplate.Triggers>
						<EventTrigger RoutedEvent="Loaded">
							<BeginStoryboard>
								<Storyboard Storyboard.DesiredFrameRate="30">
									<DoubleAnimation Storyboard.TargetProperty="Opacity" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="0" To="1" Duration="0:0:0.4"  />
									<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="-20" To="0" Duration="0:0:0.7"  />
								</Storyboard>
							</BeginStoryboard>
						</EventTrigger>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter Property="Visibility" Value="Visible" TargetName="bgMouseOver" />
							<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
						</Trigger>
						<Trigger Property="IsSelected" Value="True">
							<Setter Property="Visibility" Value="Visible" TargetName="bgSelected" />
							<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
						</Trigger>
						<!--<Trigger Property="IsFocused" Value="True">
							<Setter Property="Visibility" Value="Visible" TargetName="bgItem" />
							<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Background" Value="Transparent" />
							<Setter Property="Foreground" Value="Silver"/>
						</Trigger>-->
			
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style TargetType="{x:Type local:FwComboBox}">
		<Setter Property="Opacity" Value="0"/>
		<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
		<Setter Property="RenderTransform">
			<Setter.Value>
				<TranslateTransform Y="-20" />
			</Setter.Value>
		</Setter>
		<Setter Property="FocusVisualStyle" Value="{StaticResource SimpleFocusVisual}"/>
		<Setter Property="SnapsToDevicePixels"   Value="true" />
		<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
		<!--<Setter Property="BorderBrush" Value="{StaticResource transp}"/>-->
		<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
		<!--<Setter Property="Background" Value="{StaticResource BackgroundBrush}"/>-->
		<!--<Setter Property="BorderThickness" Value="{StaticResource BorderThickness}"/>-->
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
		<Setter Property="ScrollViewer.CanContentScroll"  Value="true" />
		<Setter Property="MinHeight" Value="28" />
		<Setter Property="Height" Value="28" />
		<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
		<Setter Property="VerticalContentAlignment" Value="Stretch"/>
		<Setter Property="TextBlock.TextTrimming" Value="CharacterEllipsis" />
		<Setter Property="ItemContainerStyle" Value="{StaticResource _cboItemStyle}"/>
			<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:FwComboBox}">
					<Border x:Name="_border" SnapsToDevicePixels="True"
							Background="{TemplateBinding Background}"
							BorderBrush="{TemplateBinding BorderBrush}" 
							BorderThickness="{TemplateBinding BorderThickness}">
						<Grid SnapsToDevicePixels="True">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="Auto" MaxWidth="21"/>
								<ColumnDefinition Width="Auto"/>
							</Grid.ColumnDefinitions>

							<Rectangle x:Name="rect" Grid.ColumnSpan="3"
									   Fill="{StaticResource transp}" 
									   SnapsToDevicePixels="True" Stroke="{StaticResource smoke}"
									   StrokeThickness="1"/>

							<!--Command="db:FwCommands.ClearComboBox"-->
							<!--<local:FwButton x:Name="PART_Button" Content="X" 
									Foreground="{StaticResource LightBrush}"
								HorizontalAlignment="Right" HorizontalContentAlignment="Right" 
								MaxHeight="28" MaxWidth="28" Height="28" Width="28" 
											Grid.Column="1" SnapsToDevicePixels="True" Margin="0,1,0,1"/>-->

							<ToggleButton Style="{StaticResource _toggle}"
										  SnapsToDevicePixels="True" Margin="1"
									  Grid.Column="2" Focusable="false"  ClickMode="Press"
									  Foreground="{TemplateBinding BorderBrush}"
									  IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, 
									  RelativeSource={RelativeSource TemplatedParent}}"/>

							<ContentPresenter x:Name="ContentSite" Grid.Column="0" IsHitTestVisible="False"
										  Content="{TemplateBinding SelectionBoxItem}" SnapsToDevicePixels="True"
										  ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
										  ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
										  Margin="3,0,23,0" VerticalAlignment="Center" HorizontalAlignment="Left" />

							<Popup x:Name="Popup"   SnapsToDevicePixels="True"
								   Placement="Bottom" PopupAnimation="Fade"   
								   PlacementRectangle="{Binding ElementName=_border}"
								   Grid.ColumnSpan="3" IsOpen="{TemplateBinding IsDropDownOpen}" 
									   AllowsTransparency="True" Focusable="False" >
								<Border x:Name="dropDown" SnapsToDevicePixels="True"
											Background="#555" BorderBrush="{StaticResource BorderBrush}" 
											BorderThickness="1" 
											MinWidth="{TemplateBinding ActualWidth}" 
											MaxHeight="{TemplateBinding MaxDropDownHeight}">
									<local:FwScrollViewer Margin="0" Padding="0" 
														  HorizontalScrollBarVisibility="Hidden" 
														  SnapsToDevicePixels="True">
										<VirtualizingStackPanel IsItemsHost="True" Margin="0"  SnapsToDevicePixels="True" 
																KeyboardNavigation.DirectionalNavigation="Contained"
																 MaxWidth="230" />
									</local:FwScrollViewer>
								</Border>
							</Popup>
						</Grid>
					</Border>

					<ControlTemplate.Triggers>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="True"/>
								<!--<Condition Property="AllowEffects" Value="True"/>-->
							</MultiTrigger.Conditions>
							<Setter Property="Visibility" Value="Visible" TargetName="rect"/>
							<Setter Property="StrokeThickness" Value="1" TargetName="rect"/>
							<Setter Property="Stroke" Value="{StaticResource LightBrush}" TargetName="rect"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsFocused" Value="True"/>
								<!--<Condition Property="AllowEffects" Value="True"/>-->
							</MultiTrigger.Conditions>
							<Setter Property="Visibility" Value="Visible" TargetName="rect"/>
							<Setter Property="StrokeThickness" Value="1" TargetName="rect"/>
							<Setter Property="Stroke" Value="{StaticResource AccentBrush}" TargetName="rect"/>
						</MultiTrigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Background" Value="Transparent" TargetName="_border" />
							<Setter Property="Fill" Value="Transparent" TargetName="rect" />
							<Setter Property="BorderThickness" Value="0" TargetName="_border" />
						</Trigger>
						<Trigger Property="HasItems" Value="false">
							<Setter TargetName="dropDown"  Property="MinHeight" Value="95" />
						</Trigger>
						<Trigger Property="IsGrouping" Value="true">
							<Setter Property="ScrollViewer.CanContentScroll" Value="false" />
						</Trigger>
						<Trigger SourceName="Popup"  Property="AllowsTransparency" Value="true">
							<Setter TargetName="dropDown" Property="Margin"  Value="0,2,0,0" />
						</Trigger>
						<Trigger Property="IsDropDownOpen" Value="true">
							<Setter Property="Opacity" Value="0.3" TargetName="rect" />
						</Trigger>
						<EventTrigger RoutedEvent="Loaded">
							<BeginStoryboard>
								<Storyboard Storyboard.DesiredFrameRate="30">
									<DoubleAnimation Storyboard.TargetProperty="Opacity" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="0" To="1" Duration="0:0:0.4"  />
									<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="-20" To="0" Duration="0:0:0.7"  />
								</Storyboard>
							</BeginStoryboard>
						</EventTrigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<!-- Scroll Bars -->
	<Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
		<Setter Property="Background" Value="{StaticResource LightBrush}"/>
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type RepeatButton}">
					<Rectangle Fill="{TemplateBinding Background}"  SnapsToDevicePixels="true"  Opacity="0.3"  />
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
		<Setter Property="Background" Value="{StaticResource LightBrush}"/>
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Thumb}">
					<Grid SnapsToDevicePixels="true" >
						<Rectangle x:Name="PART_Bg" Fill="{TemplateBinding Background}" Opacity="0.5"  SnapsToDevicePixels="true" />
						<Rectangle x:Name="PART_Rect" Fill="{StaticResource AccentBrush}" Opacity="0"  SnapsToDevicePixels="true" />
					</Grid>
					<ControlTemplate.Triggers>
						<EventTrigger RoutedEvent="MouseEnter">
							<BeginStoryboard>
								<Storyboard Storyboard.DesiredFrameRate="30">
									<DoubleAnimation Storyboard.TargetProperty="Opacity" 
															Storyboard.TargetName="PART_Bg"
															 AccelerationRatio="0.1" 
															DecelerationRatio="0.3" 
															To="0" Duration="0:0:0.1"  />
									<DoubleAnimation Storyboard.TargetProperty="Opacity" 
															Storyboard.TargetName="PART_Rect"
															 AccelerationRatio="0.1" 
															DecelerationRatio="0.3" 
															To="1" Duration="0:0:0.1"  />
								</Storyboard>
							</BeginStoryboard>
						</EventTrigger>
						<EventTrigger RoutedEvent="MouseLeave">
							<BeginStoryboard>
								<Storyboard Storyboard.DesiredFrameRate="30">
									<DoubleAnimation Storyboard.TargetProperty="Opacity" 
															Storyboard.TargetName="PART_Bg"
															 AccelerationRatio="0.1" 
															DecelerationRatio="0.3" 
															To="0.5" Duration="0:0:0.3"  />
									<DoubleAnimation Storyboard.TargetProperty="Opacity" 
															Storyboard.TargetName="PART_Rect"
															 AccelerationRatio="0.1" 
															DecelerationRatio="0.3" 
															To="0" Duration="0:0:0.3"  />
								</Storyboard>
							</BeginStoryboard>
						</EventTrigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<!-- Scroll Bars Viewer -->
	<ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type local:FwScrollBar}">
		<Grid SnapsToDevicePixels="true" >
			<Grid.RowDefinitions>
				<RowDefinition MaxHeight="12"/>
				<RowDefinition Height="0.00001*"/>
				<RowDefinition MaxHeight="12"/>
			</Grid.RowDefinitions>

			<Track Name="PART_Track" Grid.Row="0" Grid.RowSpan="3" 
				   IsDirectionReversed="true" SnapsToDevicePixels="true" >
				<Track.DecreaseRepeatButton>
					<RepeatButton Style="{StaticResource ScrollBarPageButton}" 
								   SnapsToDevicePixels="true" 
								  Command="ScrollBar.PageUpCommand" Width="4" />
				</Track.DecreaseRepeatButton>
				<Track.Thumb>
					<Thumb x:Name="thumb" Style="{StaticResource ScrollBarThumb}" Width="4" 
						   Cursor="SizeNS"  Margin="0"   SnapsToDevicePixels="true" />
				</Track.Thumb>
				<Track.IncreaseRepeatButton>
					<RepeatButton Style="{StaticResource ScrollBarPageButton}"
								   SnapsToDevicePixels="true" 
									Command="ScrollBar.PageDownCommand" Width="4" />
				</Track.IncreaseRepeatButton>
			</Track>
		</Grid>
		<ControlTemplate.Triggers>
			<EventTrigger RoutedEvent="MouseEnter">
				<BeginStoryboard>
					<Storyboard Storyboard.DesiredFrameRate="30">
						<DoubleAnimation Storyboard.TargetProperty="Width" 
														Storyboard.TargetName="thumb"
														 AccelerationRatio="0.1" 
														DecelerationRatio="0.3" 
														To="12" Duration="0:0:0.1"  />
					</Storyboard>
				</BeginStoryboard>
			</EventTrigger>
			<EventTrigger RoutedEvent="MouseLeave">
				<BeginStoryboard>
					<Storyboard Storyboard.DesiredFrameRate="30">
						<DoubleAnimation Storyboard.TargetProperty="Width" 
									Storyboard.TargetName="thumb"
								AccelerationRatio="0.1" DecelerationRatio="0.3" 
									BeginTime="0:0:1" To="4" Duration="0:0:0.3"  />
					</Storyboard>
				</BeginStoryboard>
			</EventTrigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type local:FwScrollBar}">
		<Grid  SnapsToDevicePixels="true" >
			<Grid.ColumnDefinitions>
				<ColumnDefinition MaxWidth="12"/>
				<ColumnDefinition Width="0.00001*"/>
				<ColumnDefinition MaxWidth="12"/>
			</Grid.ColumnDefinitions>

			<Track Name="PART_Track" Grid.Column="0" Grid.ColumnSpan="3" 
				   IsDirectionReversed="False" SnapsToDevicePixels="true" >
				<Track.DecreaseRepeatButton>
					<RepeatButton Style="{StaticResource ScrollBarPageButton}" 
								   SnapsToDevicePixels="true" 
								  Command="ScrollBar.PageLeftCommand" Height="4" />
				</Track.DecreaseRepeatButton>
				<Track.Thumb>
					<Thumb x:Name="thumb" Style="{StaticResource ScrollBarThumb}" Height="4" 
							SnapsToDevicePixels="true" 
							Cursor="SizeWE"  Margin="0" Background="{StaticResource LightBrush}" />
				</Track.Thumb>
				<Track.IncreaseRepeatButton>
					<RepeatButton Style="{StaticResource ScrollBarPageButton}"
								   SnapsToDevicePixels="true" 
									Command="ScrollBar.PageRightCommand" Height="4" />
				</Track.IncreaseRepeatButton>
			</Track>
		</Grid>
		<ControlTemplate.Triggers>
			<EventTrigger RoutedEvent="MouseEnter">
				<BeginStoryboard>
					<Storyboard Storyboard.DesiredFrameRate="30">
						<DoubleAnimation Storyboard.TargetProperty="Height" 
								Storyboard.TargetName="thumb"
								AccelerationRatio="0.1" DecelerationRatio="0.3" 
											To="12" Duration="0:0:0.1"  />

					</Storyboard>
				</BeginStoryboard>
			</EventTrigger>
			<EventTrigger RoutedEvent="MouseLeave">
				<BeginStoryboard>
					<Storyboard Storyboard.DesiredFrameRate="30">
						<DoubleAnimation Storyboard.TargetProperty="Height" 
								Storyboard.TargetName="thumb" BeginTime="0:0:1"
									AccelerationRatio="0.1" DecelerationRatio="0.3" 
											To="4" Duration="0:0:0.3"  />

					</Storyboard>
				</BeginStoryboard>
			</EventTrigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<Style TargetType="{x:Type local:FwScrollBar}">
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="Focusable" Value="False" />
		<Style.Triggers>
			<Trigger Property="Orientation" Value="Horizontal">
				<Setter Property="Width" Value="Auto"/>
				<Setter Property="Height" Value="12" />
				<Setter Property="Background" Value="{StaticResource transp}"/>
				<Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
			</Trigger>
			<Trigger Property="Orientation" Value="Vertical">
				<Setter Property="Width" Value="12"/>
				<Setter Property="Background" Value="{StaticResource transp}"/>
				<Setter Property="Height" Value="Auto" />
				<Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
			</Trigger>
		</Style.Triggers>
	</Style>
	<Style TargetType="{x:Type local:FwScrollViewer}">
		<Setter Property="FocusVisualStyle" Value="{StaticResource SimpleFocusVisual}"/>
		<Setter Property="BorderBrush" Value="{StaticResource transp}"/>
		<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
		<Setter Property="Background" Value="{StaticResource transp}"/>
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="Focusable" Value="False" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:FwScrollViewer}">
					<Border Background="{TemplateBinding Background}"
							BorderBrush="{TemplateBinding BorderBrush}"
							BorderThickness="{TemplateBinding BorderThickness}"
							 SnapsToDevicePixels="true" >
						<Grid SnapsToDevicePixels="true" >
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*" />
								<ColumnDefinition Width="Auto"/>
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="*"/>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
							</Grid.RowDefinitions>

							<!--<ScrollContentPresenter Grid.Row="1" Margin="0,0,8,0"  SnapsToDevicePixels="true" />-->
							<ScrollContentPresenter x:Name="PART_ScrollPresenter" Grid.Row="1" Margin="0,0,0,0"  SnapsToDevicePixels="true" >

							</ScrollContentPresenter>

							<local:FwScrollBar x:Name="PART_VerticalScrollBar" 
											   Grid.Row="0" Grid.RowSpan="2" 
											   Grid.Column="0" Grid.ColumnSpan="2"
									Background="{StaticResource transp}"
									Value="{TemplateBinding VerticalOffset}" HorizontalAlignment="Right" 
									Maximum="{TemplateBinding ScrollableHeight}"
									ViewportSize="{TemplateBinding ViewportHeight}"
									Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
												SnapsToDevicePixels="true" >
							</local:FwScrollBar>


							<local:FwScrollBar x:Name="PART_HorizontalScrollBar"
									Orientation="Horizontal" Grid.Row="2" 
									Background="{StaticResource transp}"
									Value="{TemplateBinding HorizontalOffset}"
									Maximum="{TemplateBinding ScrollableWidth}"
									ViewportSize="{TemplateBinding ViewportWidth}"
									Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
												SnapsToDevicePixels="true" />

							<Border x:Name="PART_Top" Grid.Row="0" Grid.ColumnSpan="2" SnapsToDevicePixels="true" 
									BorderThickness="0,0,0,3" BorderBrush="{StaticResource AccentBrush}"
									Height="30" Visibility="Collapsed" Background="{StaticResource radialBrush}">
								<Grid Background="{StaticResource penBrush}" Cursor="Hand">
									<local:FwButton x:Name="btnUp" Command="ScrollBar.PageUpCommand" 
													SnapsToDevicePixels="true" >
										<Viewbox>
											<Canvas Margin="-5" Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0" SnapsToDevicePixels="true" >
												<Path Width="28.5" Height="25.3333" Canvas.Left="23.6016" Canvas.Top="24.9375" Stretch="Fill" 
												  Fill="{StaticResource ForegroundInvertBrush}" SnapsToDevicePixels="true" 
												  Data="F1 M 37.8516,39.5833L 52.1016,24.9375L 52.1016,35.2292L 37.8516,50.2708L 23.6016,35.2292L 23.6016,24.9375L 37.8516,39.5833 Z "/>
											</Canvas>
										</Viewbox>
									</local:FwButton>
								</Grid>
							</Border>
							<Border x:Name="PART_Bottom" Grid.Row="3"  Grid.ColumnSpan="2"
									Background="{StaticResource AccentBrush}" 
									Height="30" Visibility="Collapsed">
							</Border>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="ComputedVerticalScrollBarVisibility" Value="Visible" >
							<Setter TargetName="PART_ScrollPresenter" Property="Margin" Value="0,0,6,0" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- Expander -->
	<ControlTemplate x:Key="_expanderHeader" TargetType="{x:Type ToggleButton}">
		<Border x:Name="ExpanderButtonBorder" Cursor="Hand" Background="Green"
				 SnapsToDevicePixels="True" MinHeight="24" MinWidth="24"  >
			<Grid SnapsToDevicePixels="True" >
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition Width="Auto"/>
				</Grid.ColumnDefinitions>

				<Border Height="24" Width="24" Grid.Column="2" SnapsToDevicePixels="True">
					<Viewbox SnapsToDevicePixels="True">
						<Path x:Name="Arrow" Data="M 1,1.5 L 4.5,5 8,1.5" Margin="8,0,5,0"
								Stroke="{StaticResource BorderBrush}" Opacity="0.8" SnapsToDevicePixels="True" 
									StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center"
										RenderTransformOrigin="0.5,0.5">
							<Path.RenderTransform>
								<RotateTransform Angle="0"/>
							</Path.RenderTransform>
						</Path>
					</Viewbox>
				</Border>
				
				<ContentPresenter x:Name="HeaderContent" SnapsToDevicePixels="True" 
								  Grid.Column="1" Margin="7,0,2,0" 
								  ContentSource="Content">
				</ContentPresenter>
			</Grid>
		</Border>

		<ControlTemplate.Triggers>
			<Trigger Property="IsChecked" Value="True">
				<Trigger.EnterActions>
					<BeginStoryboard>
						<Storyboard Storyboard.DesiredFrameRate="30">
							<DoubleAnimation Storyboard.TargetName="Arrow"
											 AccelerationRatio="0.3" DecelerationRatio="0.7"
								Storyboard.TargetProperty="(Path.RenderTransform).(RotateTransform.Angle)"
												 To="180" Duration="0:0:0.4"/>
						</Storyboard>
					</BeginStoryboard>
				</Trigger.EnterActions>
				<Trigger.ExitActions>
					<BeginStoryboard>
						<Storyboard Storyboard.DesiredFrameRate="30">
							<DoubleAnimation Storyboard.TargetName="Arrow"
											 AccelerationRatio="0.3" DecelerationRatio="0.7"
								Storyboard.TargetProperty="(Path.RenderTransform).(RotateTransform.Angle)"
												 To="0" Duration="0:0:0.4"/>
						</Storyboard>
					</BeginStoryboard>
				</Trigger.ExitActions>
			</Trigger>

			<!-- MouseOver, Pressed behaviours-->
			<!--<Trigger Property="IsMouseOver" Value="true">
				<Setter Property="Stroke" Value="{StaticResource LightBrush}" TargetName="Arrow"/>
			</Trigger>
			<Trigger Property="IsPressed" Value="true">
				<Setter Property="Stroke" Value="{StaticResource LightBrush}" TargetName="Arrow"/>
			</Trigger>-->
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<ControlTemplate x:Key="_stdTemplate" TargetType="{x:Type local:FwExpander}">
		<Border SnapsToDevicePixels="True" Background="{StaticResource transp}"
							BorderBrush="{TemplateBinding BorderBrush}"
							BorderThickness="{TemplateBinding BorderThickness}">
			<Grid x:Name="root" SnapsToDevicePixels="True" RenderTransformOrigin="0.5, 0.5">
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto"/>
					<RowDefinition Height="Auto"/>
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="Auto"/>
				</Grid.ColumnDefinitions>

				<!-- Header -->
				<Border BorderThickness="0,0,0,1" SnapsToDevicePixels="True" Margin="5,0,0,0"
						 Background="{TemplateBinding HeaderBackground}"
						BorderBrush="{StaticResource BorderBrush}" Grid.ColumnSpan="2"	/>
				<Label x:Name="lblTitle" Content="{TemplateBinding Title}" Grid.Column="0" 
								FontSize="14" SnapsToDevicePixels="True" VerticalAlignment="Center" 
								Foreground="{TemplateBinding Foreground}" Opacity="0.8" Padding="0" FontWeight="Bold"
								Margin="5,0,0,0"  >
				</Label>
				<local:FwToggleButton x:Name="ExpanderButton" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,3,0"
									 SnapsToDevicePixels="True" FocusVisualStyle="{StaticResource SimpleFocusVisual}"
										Template="{StaticResource _expanderHeader}"
											Content="{TemplateBinding Header}" 
												IsChecked="{Binding Path=IsExpanded, 
												RelativeSource={RelativeSource TemplatedParent}}" >
				</local:FwToggleButton>

				<Border Grid.Row="1" Grid.ColumnSpan="2" 
						BorderThickness="0,0,0,1" Margin="5,0,0,0" 
						Opacity="0.5" SnapsToDevicePixels="True" >
					<Border.BorderBrush>
						<VisualBrush>
							<VisualBrush.Visual>
								<Rectangle Stroke="{StaticResource BorderBrush}" StrokeDashArray="4 2" StrokeThickness="1"
											SnapsToDevicePixels="True" 
										Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualWidth}"
										Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualHeight}"/>
							</VisualBrush.Visual>
						</VisualBrush>
					</Border.BorderBrush>
				</Border>
				
				<ContentPresenter x:Name="ExpanderContent" Grid.Row="1" Grid.ColumnSpan="2" SnapsToDevicePixels="True" 
								Visibility="{TemplateBinding IsExpanded, Converter={StaticResource btvConverter}}"
									HorizontalAlignment="Stretch" ContentSource="Content" Opacity="0" Margin="5,0,0,0" >
					<ContentPresenter.RenderTransform>
						<TranslateTransform Y="-10" />
					</ContentPresenter.RenderTransform>
					<ContentPresenter.LayoutTransform>
						<RotateTransform x:Name="rotateContent"  />
					</ContentPresenter.LayoutTransform>
				</ContentPresenter>
			</Grid>
			<Border.LayoutTransform>
				<RotateTransform x:Name="rotateRoot" />
			</Border.LayoutTransform>
		</Border>

		<ControlTemplate.Triggers>
			<EventTrigger RoutedEvent="Loaded">
				<BeginStoryboard>
					<Storyboard Storyboard.DesiredFrameRate="30">
						<DoubleAnimation Storyboard.TargetProperty="Opacity" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="0" To="1" Duration="0:0:0.4"  />
						<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" 
										AccelerationRatio="0.3" DecelerationRatio="0.7" 
										From="10" To="0" Duration="0:0:0.7"  />
					</Storyboard>
				</BeginStoryboard>
			</EventTrigger>
			<Trigger Property="IsExpanded" Value="True">
				<Trigger.EnterActions>
					<BeginStoryboard>
						<Storyboard Storyboard.DesiredFrameRate="30">
							<DoubleAnimation Storyboard.TargetName="ExpanderContent"
												AccelerationRatio="0.3" DecelerationRatio="0.7"
												 Storyboard.TargetProperty="(ContentPresenter.RenderTransform).(TranslateTransform.Y)"                                                 
												 From="-10" To="0" Duration="0:0:0.7"/>
							<DoubleAnimation Storyboard.TargetProperty="Opacity" 
														 Storyboard.TargetName="ExpanderContent"
												From="0" To="1" Duration="0:0:0.4"  />
						</Storyboard>
					</BeginStoryboard>
				</Trigger.EnterActions>
				<Trigger.ExitActions>
					<BeginStoryboard>
						<Storyboard Storyboard.DesiredFrameRate="30">
							<DoubleAnimation Storyboard.TargetName="ExpanderContent"
												AccelerationRatio="0.3" DecelerationRatio="0.7"
												 Storyboard.TargetProperty="(ContentPresenter.RenderTransform).(TranslateTransform.Y)"                                                 
												 To="-10" Duration="0:0:0.7"/>
							<DoubleAnimation Storyboard.TargetProperty="Opacity"  Storyboard.TargetName="ExpanderContent"
												From="1" To="0" Duration="0:0:0.4"  />
						</Storyboard>
					</BeginStoryboard>
				</Trigger.ExitActions>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<Style TargetType="{x:Type local:FwExpander}">
		<Setter Property="Opacity" Value="0"/>
		<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
		<Setter Property="RenderTransform">
			<Setter.Value>
				<TranslateTransform X="10" />
			</Setter.Value>
		</Setter>
		<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}" />
		<Setter Property="FocusVisualStyle" Value="{StaticResource SimpleFocusVisual}"/>
		<Setter Property="Foreground" Value="{StaticResource ForegroundInvertBrush}" />
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="SnapsToDevicePixels" Value="True" />
		<Setter Property="Template" Value="{StaticResource _stdTemplate}" />
	</Style>
	

</ResourceDictionary>
